<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"   
      xmlns:ui="http://java.sun.com/jsf/facelets">
    
    <h:head>
        <link rel="stylesheet" type="text/css" href="#{resource['css:styles.css']}" />    
    </h:head>
    
    <ui:composition template="templates/content.xhtml">
        <ui:define name="content">
        

            <h:body onload="init(#{farmUserController.signedIn})">
                <h:form id="property">
                    <h:panelGrid columns="2">
                        Email: <h:inputText value="#{propertyController.bean.email}" />
                        Property Address: <h:inputText value="#{propertyController.bean.address}"></h:inputText>
                        City: <h:inputText value="#{propertyController.bean.city}" ></h:inputText>
                        State: <h:inputText value="#{propertyController.bean.state}" ></h:inputText>
                        Zip Code: <h:inputText value="#{propertyController.bean.zip}" ></h:inputText>
                        Price: <h:inputText value="#{propertyController.bean.price}" ></h:inputText>
                        For Sale or Purchased: <h:selectOneMenu value="#{propertyController.bean.isPurchased}" >
                            <f:selectItem itemValue="forSale" itemLabel="For Sale" />
                            <f:selectItem itemValue="purchased" itemLabel="Purchased" />
                        </h:selectOneMenu>
                        Acres: <h:inputText value="#{propertyController.bean.acre}" ></h:inputText>
                        Description: <h:inputText value="#{propertyController.bean.description}" ></h:inputText>
                        Bedrooms: <h:inputText value="#{propertyController.bean.bedrooms}" ></h:inputText>
                        Bathrooms: <h:inputText value="#{propertyController.bean.bathrooms}" ></h:inputText>
                        Half Baths: <h:inputText value="#{propertyController.bean.halfbaths}" ></h:inputText>
                        Highlight Property:<h:selectBooleanCheckbox value="#{propertyController.bean.isHighlight}" ></h:selectBooleanCheckbox> 
                        <!--Send Email:<h:selectBooleanCheckbox value="#{propertyController.sendEmail}" ></h:selectBooleanCheckbox>--> 
                    </h:panelGrid>


                    <br/>
                    <br/>
                    <h:commandButton value="Upload Property" action="#{propertyController.uploadProperty()}" />
                    <h:message for="property" style="color:red" />

                </h:form>
                
                <script type="text/javascript">
                        if (#{farmUserController.signedIn} === false)
                            window.location = "index.xhtml" ;
                </script>
            </h:body>
            
        </ui:define>
    </ui:composition>

</html>
